package com.example.administrator.jinritoutiao.fragment;


import android.media.Image;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;

import com.example.administrator.jinritoutiao.R;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;

/**
 * A simple {@link Fragment} subclass.
 */
public class FragmentGuide extends Fragment {


    public FragmentGuide() {
        // Required empty public constructor


    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_fragment_guide, container, false);
        Bundle bundle = getArguments();
        int pic = bundle.getInt("pic");
        ImageView iv = (ImageView) view.findViewById(R.id.iv_guide);
        Button bt = (Button) view.findViewById(R.id.bt_guide);
        ImageLoader.getInstance().init(ImageLoaderConfiguration.createDefault(getActivity()));
        DisplayImageOptions options = new DisplayImageOptions.Builder().showImageOnLoading(pic).build();
        ImageLoader.getInstance().displayImage("",iv,options);
        iv.setImageResource(pic);
        if(pic == R.drawable.z7){
            bt.setVisibility(View.VISIBLE);
        }
        return view;
    }

}
